﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media.Media3D;
using System.Windows.Media;
using System.IO;

namespace SkeletalAnimation3D
{
    public class MaterialLibrary
    {
        private Dictionary<string, Material> _materials = new Dictionary<string, Material>();

        public MaterialLibrary(string fileName)
        {

        }

        public Material this[string materialName]
        {
            get
            {
                lock (_materials)
                {
                    if (!_materials.ContainsKey(materialName))
                    {
                        _materials.Add(materialName, LoadMaterial(materialName));
                    }
                    return _materials[materialName];
                }
            }
        }

        private Material LoadMaterial(string materialName)
        {
            Material material = new DiffuseMaterial(Brushes.Blue);
            return material;
        }

        public static MaterialLibrary Load(Stream materialLibraryStream)
        {
            return new MaterialLibrary(String.Empty);
        }

        public void Save(Stream materialLibraryStream)
        {
            throw new NotImplementedException();
        }
    }
}
